Chris Pollett >
Old Classses > |
HW#1 --- last modified February 07 2019 04:33:53..Due date: Sep 9
Files to be submitted: Purpose: To get our OpenGL Environment set-up and to write a first simple program using shaders. Related Course Outcomes: The main course outcomes covered by this assignment are: LO3 -- Write an OpenGL program using shaders. Specification: For this assignment, I would like you to go to the book's code website. There you will find a link to setting up OpenGL for Windows, Mac, and Linux. OSX uses a slightly older flavor of OpenGL. As I am not sure what platform the grader will be grading on, I want you to modify a base program that I know works on all three platforms. So download the zip file HelloWorld2D (new version) . As a first step, I would like you to get this program to compile on your machine. As an aside for Mac user's, rather than try to get the glew library to compile from sources, it might be easier to use Homebrew and then type: brew install glew In asst1.cpp on a Mac, I had to change the constant gl_GL2Compatible to true. Once you have this program working, I next want you to modify it so that rather than just draw one rectangle with gradient colors and a texture image, it instead draws a 3x3 checkerboard pattern. The "dark squares" in this pattern should be the image from the original program. The "light squares" should not be textured but should be colored with a different gradient of colors. Finally, if the window is re-sized I would like all the squares in the checkerboard to remain squares not rectangles. I don't want the image to be cropped, but I would like the squares to get scaled if possible. Your program should not modify the call to glViewport, but is allowed to modify the vertex shader and the uniform variables that are used in the shader. In the ZIP file that you submit make sure to include each of the files that was in the original project. Point Breakdown
|